package com.wlcj.www.model.platform;

import com.jfinal.plugin.activerecord.Model;
import com.wlcj.util.CacheKeyUtil;
import com.wlcj.util.RedisUtil;
import com.wlcj.util.SqlUtil;

public class PlatformImg extends Model<PlatformImg> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5075848115050657228L;
	
	public static final PlatformImg dao = new PlatformImg();
	
	public PlatformImg getCachePlatformImgByPid(int pid) {
		String key = CacheKeyUtil.getPlatformImgKey(pid);
		PlatformImg p = RedisUtil.get(key);
		if(p==null) {
			p = findFirst(SqlUtil.sql("platform.getPlatformImgByPid"), pid);
			RedisUtil.set(key, p);
		}
		return p;
	}

}
